
<%@ include file="../common.jsp"%>
<script type="text/javascript">
	$(document).ready(
		
			function() {
				$("#docType").attr("action",'<c:url value="/saveDocType.htm"></c:url>');
				$("#dtName").focus();
			});
		
</script>
<form:form commandName="documentTypeDTO" id="docType">
	<table class="adminFilterTable">
		<tr class="tableChildHeaderColor">
			<td colspan="6" align="center"> ADD NEW DOCUMENT TYPE </td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr> 
			<td align="left" colspan="5" style="font-family: verdana; font-size: 12px;"> All fields are mandatory.</td> 
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Name </td>
			<td class="spacingColumnWidthLess"></td>
			<td class="formField"> <form:input path="dtName" id="dtName"/>
					<form:errors path="dtName" cssClass="errorMessage"></form:errors>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td class="formLabel"> Code </td>
			<td class="spacingColumnWidthLess"></td>
			<td class="formField"> <form:input path="dtCode"/> 
				<form:errors path="dtCode" cssClass="errorMessage"></form:errors>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td class="spacingColumnWidthLess"></td>
			<td></td>
			<td class="spacingColumnWidthLess"></td>
			<td colspan="2" align="left">
				<input class="formButton ui-corner-all" type="button" value="SAVE" onclick="javascript:addEntity('docType')"></input>
			</td>
			<td class="spacingColumnWidthLess"></td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
	</table>
</form:form>
<c:if test="${errorCount eq 0}">
	<c:choose>
		<c:when test="${resultOfEntry}">
			Operation Done Successfully
		</c:when>
		<c:otherwise>
			Error. <br>
			Entered document type already exists.
		</c:otherwise>
	</c:choose>
</c:if>